import { request } from "./request.js";

const api = {
  /**
   * 登录
   */
  login(data) {
    return request({
      url: "/user/login",
      data: data,
      method: "POST",
    });
  },
    /**
   * 注册
   */
  register(data) {
    return request({
      url: "/user/register",
      data: data,
      method: "POST"
    });
  },
  /**
   * 首页讨论区列表
   */
  discussList(data) {
    return request({
      url: "/wx/discuss/list",
      data: data,
      method: "GET"
    });
  },
    /**
   * 首页讨论区新增
   */
  discussAdd(data) {
    return request({
      url: "/wx/discuss/add",
      data: data,
      method: "POST",
    });
  },
    /**
   * 作品列表
   */
  articleList(data) {
    return request({
      url: "/wx/article/list",
      data: data,
      method: "GET",
    });
  },
  /**
   * 作品新增
   */
  articleAdd(data) {
    return request({
      url: "/wx/article/add",
      data: data,
      method: "POST",
    });
  },
    /**
   * 作品修改
   */
  articleEdit(data) {
    return request({
      url: "/wx/article/update",
      data: data,
      method: "POST",
    });
  },
  /**
   * 作品获取单条
   */
  articleGet(data) {
    return request({
      url: "/wx/article/getOne",
      method: "GET",
      data: data
    });
  },
  /**
   * 反馈新增
   */
  messageAdd(data) {
    return request({
      url: "/wx/message/add",
      data: data,
      method: "POST",
    });
  }
}

export default {
  api
};
